package cn.xlmdz.subsoilerinfoquery.http;

import java.util.Map;

import cn.xlmdz.subsoilerinfoquery.bean.CarDataBean;
import cn.xlmdz.subsoilerinfoquery.bean.ContourBean;
import cn.xlmdz.subsoilerinfoquery.bean.LonLatBean;
import cn.xlmdz.subsoilerinfoquery.bean.LoginBean;
import cn.xlmdz.subsoilerinfoquery.bean.OrganizeBean;
import cn.xlmdz.subsoilerinfoquery.bean.SubsoilDataListBean;
import cn.xlmdz.subsoilerinfoquery.bean.UpdateBean;
import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;

public interface ApiServices {

    //登录
    @FormUrlEncoded
    @POST("user/login")
    Observable<LoginBean> login(@FieldMap Map<String, String> params);

    // 获取作业数据列表
    @FormUrlEncoded
    @POST("work/odayna")
    Observable<SubsoilDataListBean> getSubsoilData(@FieldMap Map<String, String> params);

    //组织列表，到合作社
    @POST("org/tree_cooperation")
    Observable<OrganizeBean> getOrganizeTreeData(@Header("token") String token);

    //获取车辆列表
    @FormUrlEncoded
    @POST("car/list")
    Observable<CarDataBean> getCarListData(@Header("token") String token, @FieldMap Map<String, String> params);

    //获取轨迹列表
    @FormUrlEncoded
    @POST("place/lonlat")
    Observable<LonLatBean> getLonLatData(@Header("token") String token, @FieldMap Map<String, String> params);

    //获取地块轮廓列表
    @FormUrlEncoded
    @POST("place/contour")
    Observable<ContourBean> getContourData(@Header("token") String token, @FieldMap Map<String, String> params);

    // 获取深松数据列表
    @GET("lmdz_ssj_update.json")
    Observable<UpdateBean> getNewVersion();
}
